home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / OCETemplates.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  87.2 KB  |  1,812 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        OCETemplates.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment Templates Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __OCETEMPLATES__
  18. #define __OCETEMPLATES__
  19.  
  20. #ifndef REZ
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __EVENTS__
  25. #include <Events.h>
  26. #endif
  27.  
  28. #endif /* REZ */
  29. #ifndef __OCE__
  30. #include <OCE.h>
  31. #endif
  32.  
  33. #ifndef REZ
  34. #ifndef __OCESTANDARDMAIL__
  35. #include <OCEStandardMail.h>
  36. #endif
  37.  
  38.  
  39.  
  40. #if PRAGMA_ONCE
  41. #pragma once
  42. #endif
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47.  
  48. #if PRAGMA_IMPORT
  49. #pragma import on
  50. #endif
  51.  
  52. #if PRAGMA_STRUCT_ALIGN
  53.     #pragma options align=mac68k
  54. #elif PRAGMA_STRUCT_PACKPUSH
  55.     #pragma pack(push, 2)
  56. #elif PRAGMA_STRUCT_PACK
  57.     #pragma pack(2)
  58. #endif
  59.  
  60. #endif /* REZ */
  61.  
  62.  
  63. /************************************************************************************************
  64.  ********************************* Template Resource Constants: *********************************
  65.  ************************************************************************************************/
  66.  
  67.  
  68. /* Current versions of all the different template types: */
  69.  
  70. #define kDETAspectVersion        -976
  71. #define kDETInfoPageVersion        -976
  72. #define kDETKillerVersion        -976
  73. #define kDETForwarderVersion    -976
  74. #define kDETFileTypeVersion        -976
  75.  
  76.  
  77. /*    'Normal' separation for template IDs within the file (this is just a suggestion; you can use whatever
  78.     separation you like, so long as two separate templates don't have overlapping resources): */
  79. #define kDETIDSep 250
  80.  
  81. /* A few predefined base IDs (again, just suggestions): */
  82. #define kDETFirstID        (1000)
  83. #define kDETSecondID    (1000+kDETIDSep)
  84. #define kDETThirdID        (1000+2*kDETIDSep)
  85. #define kDETFourthID    (1000+3*kDETIDSep)
  86. #define kDETFifthID        (1000+4*kDETIDSep)
  87.  
  88.  
  89.  
  90. /*    Templates consist of a set of associated resources, at constant offsets from a 'base ID' set by the
  91.     signature resource of the template. In the case of aspect templates, most of the resources in the
  92.     template are accessible from the template as property default values. The property number is the same
  93.     as the offset from the base ID of the resource. In describing the resources which make up templates,
  94.     we give the type, the offset, and a description. For aspect templates, the offset is also the property #. 
  95.     
  96.     All templates include the following resource fork resources:
  97.  
  98.      Type    Offset                        Description
  99.      ----    ------                        -----------
  100.     'rstr'    kDETTemplateName            Contains the name of the template
  101.  
  102. */
  103.  
  104. #define kDETTemplateName 0
  105.  
  106. /*    Aspects, info-pages, and forwarders include the following as well:
  107.  
  108.      Type    Offset                        Description
  109.      ----    ------                        -----------
  110.     'rstr'    kDETRecordType                Contains the type of record this applies to
  111.     'rstr'    kDETAttributeType            Contains the type of attribute this applies to
  112.     'detn'    kDETAttributeValueTag        Contains the tag of the attribute values this applies to
  113.  
  114. */
  115.  
  116. #define kDETRecordType                1
  117. #define kDETAttributeType            2
  118. #define kDETAttributeValueTag        3
  119.  
  120.  
  121.  
  122. /* ************************************ Aspects */
  123.  
  124. /*    In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  125.     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  126.     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  127.     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  128.     the case of kDETAspectName), it indicates the type for the dynamically generated property. A resource type of
  129.     'rstr' corresponds to a property type of kDETPrTypeString; type 'detn' corresponds to kDETPrTypeNumber; and
  130.     'detb' corresponds to kDETPrTypeBinary.
  131.  
  132.  
  133.  
  134.      Type    Offset                        Description
  135.      ----    ------                        -----------
  136.     'deta'    0                            Identifies the type of resource
  137.     'detc'    kDETCode                    Is the code resource, if any is used
  138.     'ICN#'    kDETAspectMainBitmap
  139.     'icl8'    kDETAspectMainBitmap
  140.     'icl4'    kDETAspectMainBitmap
  141.     'ics#'    kDETAspectMainBitmap
  142.     'ics8'    kDETAspectMainBitmap
  143.     'ics4'    kDETAspectMainBitmap
  144.     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  145.     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  146.     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  147.     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  148.                                         kDETAspectCategory; if this resource is not present, external names are taken from
  149.                                         another template; if no other template provides an external name for a given internal
  150.                                         category, the internal name is used as the external name (main aspect only)
  151.     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  152.     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  153.     'rstr'    kDETAspectWhatIs            Is the string for balloon help when item is in sublist (main aspect only)
  154.     'rstr'    kDETAspectAliasKind            Is the item kind to display for aliases to this type of item (main aspect only)
  155.     'detn'    kDETAspectAliasGender        Is the gender of an alias to this kind of object for internationalization (main aspect only)
  156.     'rstr'    kDETAspectAliasWhatIs        Is the string for balloon help when an alias to the item is in sublist (main aspect only)
  157.     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item in an info-page, it's
  158.                                         property # times 2 is used as an index into this array; if the item is not editable,
  159.                                         then the property # times 2 plus 1 is used
  160.  
  161.  
  162.     'rstr'    kDETAspectNewMenuName        Is the string to be used for the user to select new item creation; for records, the
  163.                                         string is used as a menu entry in the Catalogs menu; for attributes, the string
  164.                                         is used in a selection dialog invoked by an 'Add...' button
  165.     'rstr'    kDETAspectNewEntryName        Is the name to be used for new records (with a digit appended if not unique)
  166.     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  167.                                         is the tag; the rest is the attribute value contents
  168.     'detn'    kDETAspectSublistOpenOnNew    If true (non-zero), automatically open newly created entries (property can be set
  169.                                         from a code resource, or via a default value in a resource)
  170.     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  171.     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect (if any)
  172.     'rstr'    kDETAspectDragInVerb        Is a single, short word that's the verb of the action (like 'add' or 'drop'; if
  173.                                         there's any doubt, use 'OK')
  174.     'rstr'    kDETAspectDragInSummary        Is a short phrase that describes the action, suitable to be included in a selection list
  175.     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  176.                                         can be dragged into this aspect, and the second is the attribute type to store
  177.                                         the reference in
  178.     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  179.                                         category of records which can be dragged in, and the second is the type of
  180.                                         attribute to place the alias in
  181.     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  182.                                         dragged from (or '' for any), the second is the attribute type which can be dragged
  183.                                         in, and the third is the attribute type to store the new attribute in
  184.  
  185.  
  186.     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect (an 'rst#'
  187.                                         resource with no entries means nothing can be dragged out; no 'rst#' resource means
  188.                                         everything can be dragged out)
  189.     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  190.     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  191.     'detw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  192.                                             page-selector (main aspect only)
  193.     'detv'    kDETAspectInfoPageCustomWindow    Is a view list which is common to all info-pages (main aspect only)
  194. */
  195.  
  196.  
  197. #define kDETAspectCode                     4
  198. #define kDETAspectMainBitmap             5
  199. #define kDETAspectName                     6
  200. #define kDETAspectCategory                 7
  201. #define kDETAspectExternalCategory         8
  202. #define kDETAspectKind                     9
  203. #define kDETAspectGender                10
  204. #define kDETAspectWhatIs                11
  205. #define kDETAspectAliasKind                12
  206. #define kDETAspectAliasGender            13
  207. #define kDETAspectAliasWhatIs            14
  208. #define kDETAspectBalloons                15
  209. #define kDETAspectNewMenuName            16
  210. #define kDETAspectNewEntryName            17
  211. #define kDETAspectNewValue                18
  212. #define kDETAspectSublistOpenOnNew        19
  213. #define kDETAspectLookup                20
  214. #define kDETAspectDragInString            21
  215. #define kDETAspectDragInVerb            22
  216. #define kDETAspectDragInSummary            23
  217. #define kDETAspectRecordDragIn            24
  218. #define kDETAspectRecordCatDragIn        25
  219. #define kDETAspectAttrDragIn            26
  220. #define kDETAspectAttrDragOut            27
  221. #define kDETAspectViewMenu                28
  222. #define kDETAspectReverseSort            29
  223. #define kDETAspectInfoPageCustomWindow    30
  224.  
  225.  
  226.  
  227. /* Properties: */
  228.  
  229. #define kDETNoProperty                -1
  230.  
  231. /* Each aspect has 250 attribute properties in this range: */
  232. #define kDETFirstLocalProperty        0
  233. #define kDETLastLocalProperty         (kDETFirstLocalProperty+249)
  234.  
  235. /* Developers should use property numbers starting at this point: */
  236. #define kDETFirstDevProperty        40
  237.  
  238. /* The following range provides constant numeric properties for use in patterns and comparisons (constant n is
  239.    given by kDETFirstConstantProperty+n): */
  240. #define kDETFirstConstantProperty    250
  241. #define kDETLastConstantProperty    (kDETFirstConstantProperty+249)
  242.  
  243. /* To convert a number into a constant property, add this: */
  244. #define kDETConstantProperty        kDETFirstConstantProperty
  245.  
  246. #define kDETZeroProperty            (kDETConstantProperty+0)
  247. #define kDETOneProperty                (kDETConstantProperty+1)
  248. #define kDETFalseProperty            (kDETConstantProperty+0)
  249. #define kDETTrueProperty            (kDETConstantProperty+1)
  250.  
  251. /* The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: */
  252. #define kDETPrName                     3050
  253. #define kDETPrKind                     3051
  254.  
  255. /* Access mask properties: */
  256. #define kDETDNodeAccessMask            25825    /* The DNode access mask */
  257. #define kDETRecordAccessMask        25826    /* The record access mask */
  258. #define kDETAttributeAccessMask        25827    /* The attribute access mask */
  259. #define kDETPrimaryMaskByBit        25828    /* A set of sixteen properties to access all bits of the primary mask */
  260.  
  261.  
  262.  
  263. /* See AOCE documentation for details definitions of each of these bits: */
  264. #define kDETPrimarySeeMask            kDETPrimaryMaskByBit
  265. #define kDETPrimaryAddMask            (kDETPrimaryMaskByBit+1)
  266. #define kDETPrimaryDeleteMask        (kDETPrimaryMaskByBit+2)
  267. #define kDETPrimaryChangeMask        (kDETPrimaryMaskByBit+3)
  268. #define kDETPrimaryRenameMask        (kDETPrimaryMaskByBit+4)
  269. #define kDETPrimaryChangePrivsMask    (kDETPrimaryMaskByBit+5)
  270. #define kDETPrimaryTopMaskBit        (kDETPrimaryMaskByBit+15)
  271.  
  272. /* The following property is zero until we've completed the first catalog lookup; from then on it's 1 */
  273. #define kDETPastFirstLookup            26550
  274.  
  275. /* The following property is the page number; issuing a property command with this property will flip info-pages */
  276. #define kDETInfoPageNumber            27050
  277.  
  278. /* The value of the following properties contains the template number of the targeted aspect's template, and the
  279.    currently open info-page (if any). These values can be used with kDETAspectTemplate and kDETInfoPageTemplate
  280.    target selectors. */
  281. #define kDETAspectTemplateNumber    26551
  282. #define kDETInfoPageTemplateNumber    26552
  283.  
  284. /* Properties for property commands to deal with sublist items: */
  285. #define kDETOpenSelectedItems        26553    /* Open selected sublist items */
  286. #define kDETAddNewItem                26554    /* Add new sublist item */
  287. #define kDETRemoveSelectedItems        26555    /* Remove selected sublist items */
  288.  
  289. /* Property types are used to specify types of properties and conversions between types (zero and negative numbers
  290.    are reserved for Apple; developer code resources can use positive numbers): */
  291. #define kDETPrTypeNumber            -1    /* A number */
  292. #define kDETPrTypeString            -2    /* A string */
  293. #define kDETPrTypeBinary            -3    /* A binary block */
  294.  
  295. /* Rez-compatible tag definitions (These are the same as in OCE.h, but they're enums there and can't be rezed•••) */
  296. #ifdef REZ
  297. #define typeRString            'rstr'
  298. #define typePackedDSSpec    'dspc'
  299. #define typeBinary            'bnry'
  300. #endif
  301.  
  302.  
  303.  
  304. /* ************************************ Info-pages */
  305.  
  306. /* Info-pages include the following as well:
  307.  
  308.      Type    Offset                        Description
  309.      ----    ------                        -----------
  310.     'deti'    0                            Identifies the type of resource; see below for details on the contents
  311.     'rstr'    kDETInfoPageName            Is the name of the view to use in the page selection pop-up
  312.     'rstr'    kDETInfoPageMainViewAspect    Is the name of the aspect to use with the main page view
  313.     'rstr'    kDETInfoPageMenuName        Is the name of the catalogs menu ('Catalogs' if not present)
  314.     'detm'    kDETInfoPageMenuEntries        Are menu entries to go in the Catalogs menu
  315.  
  316. */
  317.  
  318. #define kDETInfoPageName            4
  319. #define kDETInfoPageMainViewAspect    5
  320. #define kDETInfoPageMenuName        6
  321. #define kDETInfoPageMenuEntries        7
  322.  
  323.  
  324.  
  325.  
  326. /* ************************************ Views 
  327.  
  328.    Flags: */
  329.  
  330. #define kDETNoFlags                        0
  331. #define kDETEnabled                        (1 << 0)    /* Main view (non-sublist) field enabled */
  332.  
  333. /* The following flags make sense for items in a sublist only */
  334. #define kDETHilightIfSelected            (1 << 0)    /* Hilight view when entry is selected */
  335.  
  336. /* The following flags make sense for text views only */
  337. #define kDETNumericOnly                    (1 << 3)    /* Only allow the user to enter digits */
  338. #define kDETMultiLine                    (1 << 4)    /* Allow multiple lines in view */
  339. #define kDETDynamicSize                    (1 << 9)    /* Don't draw box around text until user clicks in it, then auto-size it */
  340. #define kDETAllowNoColons                (1 << 10)    /* Don't allow the user to enter colons (convert ':'s to '-'s) */
  341.  
  342. /* The following flags are used for pop-up menus only */
  343. #define kDETPopupDynamicSize            (1 << 8)    /* Automatically resize pop-up based on contents */
  344.  
  345. /* The following flags are used for EditPicture views only */
  346. #define kDETScaleToView                    (1 << 8)    /* Scale picture to view bounds rather than cropping */
  347.  
  348. /*    Sizes for icons */
  349. #define kDETLargeIcon        0
  350. #define kDETSmallIcon        1
  351. #define kDETMiniIcon        2
  352.  
  353. /* Stolen from TextEdit.h */
  354. #define kDETLeft          0
  355. #define kDETCenter          1
  356. #define kDETRight         -1
  357. #define kDETForceLeft    -2
  358.  
  359.  
  360.  
  361. /* Flags for use within Box view type attributes - these are distinct from the flags above */
  362.  
  363. #define    kDETUnused                    0
  364. #define kDETBoxTakesContentClicks    (1 << 0)
  365. #define kDETBoxIsRounded            (1 << 1)
  366. #define kDETBoxIsGrayed                (1 << 2)
  367. #define kDETBoxIsInvisible            (1 << 3)
  368.  
  369. /* The common font info */
  370.  
  371. #define kDETApplicationFont                 1
  372. #define kDETApplicationFontSize          9
  373. #define kDETAppFontLineHeight            12
  374.  
  375. #define kDETSystemFont                     0
  376. #define kDETSystemFontSize                12
  377. #define kDETSystemFontLineHeight        16
  378.  
  379. #define kDETDefaultFont                     1
  380. #define kDETDefaultFontSize                 9
  381. #define kDETDefaultFontLineHeight        12
  382.  
  383. /*    These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): */
  384. #define kDETNormal                        0
  385. #define kDETBold                        1
  386. #define kDETItalic                        2
  387. #define kDETUnderline                    4
  388. #define kDETOutline                        8
  389. #define kDETShadow                     0x10
  390. #define kDETCondense                 0x20
  391. #define kDETExtend                     0x40
  392.  
  393. #define kDETIconStyle                   -3    /* Normal text style for regular sublist entries, italic text style for aliases */
  394.  
  395. /* View menu: */
  396.  
  397. #define    kDETChangeViewCommand        'view'    /* Change the view; used especially in StaticCommandTextFromView sublist headers */
  398.  
  399.  
  400. /* Info-page window sizes: */
  401.  
  402. /* Default record info-pages: */
  403. #define kDETRecordInfoWindHeight        228
  404. #define kDETRecordInfoWindWidth            400
  405.  
  406. /* Default attribute info-pages: */
  407. #define kDETAttributeInfoWindHeight        250
  408. #define kDETAttributeInfoWindWidth        230
  409.  
  410. /* Page identifying icon (for default info-page layout): */
  411. #define kDETSubpageIconTop        8
  412. #define kDETSubpageIconLeft        8
  413. #define kDETSubpageIconBottom    (kDETSubpageIconTop+32)
  414. #define kDETSubpageIconRight    (kDETSubpageIconLeft+32)
  415. #define kDETSubpageIconRect        {kDETSubpageIconTop, kDETSubpageIconLeft, kDETSubpageIconBottom, kDETSubpageIconRight}
  416.  
  417. /* The following rectangle can be used in a 'deti' with no sublist: */
  418. #define kDETNoSublistRect        {0, 0, 0, 0}
  419.  
  420.  
  421.  
  422.  
  423. /* ************************************ Killers 
  424.  
  425.    Killers include the following as well:
  426.  
  427.      Type    Offset                        Description
  428.      ----    ------                        -----------
  429.     'detk'    0                            Identifies the type of resource; see below for details on the contents
  430.     'rst#'    kDETKillerName                Contains a list of template names to be killed
  431.  
  432. */
  433.  
  434. #define kDETKillerName 1
  435.  
  436.  
  437. /* ************************************ Forwarders 
  438.  
  439.    Forwarders include the following as well:
  440.  
  441.      Type    Offset                        Description
  442.      ----    ------                        -----------
  443.     'detf'    0                            Identifies the type of resource; see below for details on the contents
  444.     'rst#'    kDETForwarderTemplateNames    Contains a list of names of templates to forward to
  445.  
  446. */
  447.  
  448. #define kDETForwarderTemplateNames    4
  449.  
  450.  
  451.  
  452. /*********************************************************************************** 
  453.  ********************************* Categories: ************************************* 
  454.  *********************************************************************************** 
  455.  
  456.    Internal category names: */
  457.  
  458. #define kDETCategoryAllItems        "aoce All Items"        /* Everything in or out of a category */
  459. #define kDETCategoryAddressItems    "aoce Address Items"    /* Anything that can be used to address something */
  460. #define kDETCategoryMisc            "aoce Miscellaneous"    /* Things that don't deserve their own category */
  461.  
  462.  
  463.  
  464. /***********************************************************************************/
  465. /********************************* Code Resources: *********************************/
  466. /***********************************************************************************/
  467. #ifndef REZ
  468. /* Target specification: */
  469.  
  470. enum {
  471.     kDETSelf                    = 0,                            /* The "current" item */
  472.     kDETSelfOtherAspect            = 1,                            /* Another aspect of the current item */
  473.     kDETParent                    = 2,                            /* The parent (i.e., the aspect we're in the sublist of, if any) of the current item */
  474.     kDETSublistItem                = 3,                            /* The itemNumberth item in the sublist */
  475.     kDETSelectedSublistItem        = 4,                            /* The itemNumberth selected item in the sublist */
  476.     kDETDSSpec                    = 5,                            /* The item specified by the packed DSSpec */
  477.     kDETAspectTemplate            = 6,                            /* A specific aspect template (number itemNumber) */
  478.     kDETInfoPageTemplate        = 7,                            /* A specific info-page template (number itemNumber) * Force type to be short */
  479.     kDETHighSelector            = 0xF000
  480. };
  481.  
  482. typedef long                             DETTargetSelector;
  483.  
  484. struct DETTargetSpecification {
  485.     DETTargetSelector                 selector;                    /* Target selection method (see above) */
  486.     RStringPtr                         aspectName;                    /* The name of the aspect (kDETSelfOtherAspect, kDETSublistItem,*/
  487.                                                                 /*   kDETSelectedSublistItem, kDETDSSpec); nil for main aspect or none; */
  488.                                                                 /*  always filled in for calls if there is an aspect, even if it's the main aspect */
  489.     long                             itemNumber;                    /* Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate);*/
  490.                                                                 /*   1-based indexing */
  491.     PackedDSSpecPtr                 dsSpec;                        /* DSSpec (kDETDSSpec only) */
  492. };
  493. typedef struct DETTargetSpecification    DETTargetSpecification;
  494. /* Code resource calls and call-backs both return an OSType:
  495.         kDETDidNotHandle (1)    = used by template to say "I didn't handle it" (for calls only)
  496.         noErr                    = function completed successfully
  497.         any error                = function failed, and here's why
  498. */
  499. #define kDETDidNotHandle 1
  500. /* Call-back functions:
  501.  
  502.         reqFunction                            Action
  503.         -----------                            ------
  504.         kDETcmdBeep                            Call SysBeep; useful for testing that a code resource's calls/call-backs are working at all
  505.  
  506.         kDETcmdBusy                            Put up watch cursor and switch processes; user events elicit a beep
  507.  
  508.         kDETcmdChangeCallFors                Change call-fors mask
  509.  
  510.         kDETcmdGetCommandSelectionCount        Get the command selection count (for calls which have a command selection list)
  511.         kDETcmdGetCommandItemN                Get command selection item n (for calls which have a command selection list)
  512.  
  513.         kDETcmdOpenDSSpec                    PackedDSSpec open (can also be done via AppleEvents -- this is a short-cut)
  514.  
  515.         kDETcmdAboutToTalk                    About to talk to user: bring us to front, disable watch cursor, etc.
  516.  
  517.         kDETcmdUnloadTemplates                Flush templates
  518.  
  519.         kDETcmdTemplateCounts                Return number of aspect and info-page templates in system
  520.  
  521.         kDETcmdGetDSSpec                    Get the PackedDSSpec for this object
  522.  
  523.         kDETcmdSublistCount                    Return the count of the sublist items
  524.         kDETcmdSelectedSublistCount            Return the count of the selected sublist items
  525.  
  526.         kDETcmdRequestSync                    Request a sync-up of the aspect with the catalog
  527.  
  528.         kDETcmdBreakAttribute                Break an attribute -- apply all applicable patterns to an attribute to generate properties
  529.  
  530.         kDETcmdGetTemplateFSSpec            Get the FSSpec of the file containing the template
  531.  
  532.         kDETcmdGetOpenEdit                    Return the property of the view being edited (or kDETNoProperty if none)
  533.         kDETcmdCloseEdit                    Close the current edit
  534.  
  535.         kDETcmdGetPropertyType                Get a property type
  536.  
  537.         kDETcmdGetPropertyNumber            Get a property, number format
  538.         kDETcmdGetPropertyRString            Get a property, RString format
  539.         kDETcmdGetPropertyBinarySize        Get a property, binary, return size
  540.         kDETcmdGetPropertyBinary            Get a property, binary format
  541.  
  542.         kDETcmdGetPropertyChanged            Get a property changed flag
  543.         kDETcmdGetPropertyEditable            Get a property editable flag
  544.  
  545.         kDETcmdSetPropertyType                Set a property type
  546.  
  547.         kDETcmdSetPropertyNumber            Set a property, number format
  548.         kDETcmdSetPropertyRString            Set a property, RString format
  549.         kDETcmdSetPropertyBinary            Set a property, binary data & size
  550.  
  551.         kDETcmdSetPropertyChanged            Set a property changed flag
  552.         kDETcmdSetPropertyEditable            Set a property editable flag
  553.  
  554.         kDETcmdDirtyProperty                Dirty a property (notify other code resources of change)
  555.  
  556.         kDETcmdDoPropertyCommand            Issue a property command
  557.  
  558.         kDETcmdAddMenu                        Add to the end of a dynamic menu
  559.         kDETcmdRemoveMenu                    Remove a dynamic menu item
  560.         kDETcmdMenuItemRString                Get a dynamic menu item RString
  561.  
  562.         kDETcmdSaveProperty                    Force a save of a property -- apply all applicable patterns to write out the property
  563.  
  564.         kDETcmdGetCustomViewUserReference    Get custom view user reference (as given in .r file)
  565.         kDETcmdGetCustomViewBounds            Get custom view current bounds
  566.  
  567.         kDETcmdGetResource                    Get a resource from a template
  568. */
  569.  
  570.  
  571. enum {
  572.     kDETcmdSimpleCallback        = 0,
  573.     kDETcmdBeep                    = 1,
  574.     kDETcmdBusy                    = 2,
  575.     kDETcmdChangeCallFors        = 3,
  576.     kDETcmdGetCommandSelectionCount = 4,
  577.     kDETcmdGetCommandItemN        = 5,
  578.     kDETcmdOpenDSSpec            = 6,
  579.     kDETcmdAboutToTalk            = 7,
  580.     kDETcmdUnloadTemplates        = 8,
  581.     kDETcmdTemplateCounts        = 9,
  582.     kDETcmdTargetedCallback        = 1000,
  583.     kDETcmdGetDSSpec            = 1001,
  584.     kDETcmdSublistCount            = 1002,
  585.     kDETcmdSelectedSublistCount    = 1003,
  586.     kDETcmdRequestSync            = 1004,
  587.     kDETcmdBreakAttribute        = 1005,
  588.     kDETcmdGetTemplateFSSpec    = 1006,
  589.     kDETcmdGetOpenEdit            = 1007,
  590.     kDETcmdCloseEdit            = 1008,
  591.     kDETcmdPropertyCallback        = 2000,
  592.     kDETcmdGetPropertyType        = 2001,
  593.     kDETcmdGetPropertyNumber    = 2002,
  594.     kDETcmdGetPropertyRString    = 2003,
  595.     kDETcmdGetPropertyBinarySize = 2004,
  596.     kDETcmdGetPropertyBinary    = 2005,
  597.     kDETcmdGetPropertyChanged    = 2006,
  598.     kDETcmdGetPropertyEditable    = 2007,
  599.     kDETcmdSetPropertyType        = 2008,
  600.     kDETcmdSetPropertyNumber    = 2009,
  601.     kDETcmdSetPropertyRString    = 2010,
  602.     kDETcmdSetPropertyBinary    = 2011,
  603.     kDETcmdSetPropertyChanged    = 2012,
  604.     kDETcmdSetPropertyEditable    = 2013,
  605.     kDETcmdDirtyProperty        = 2014,
  606.     kDETcmdDoPropertyCommand    = 2015,
  607.     kDETcmdAddMenu                = 2016,
  608.     kDETcmdRemoveMenu            = 2017,
  609.     kDETcmdMenuItemRString        = 2018,
  610.     kDETcmdSaveProperty            = 2019,
  611.     kDETcmdGetCustomViewUserReference = 2020,
  612.     kDETcmdGetCustomViewBounds    = 2021,
  613.     kDETcmdGetResource            = 2022,                            /* Force type to be long */
  614.     kDETcmdHighCallback            = (long)0xF0000000
  615. };
  616.  
  617.  
  618. typedef unsigned long                     DETCallBackFunctions;
  619. /* Call functions:
  620.  
  621.         reqFunction                        Action
  622.         -----------                        ------
  623.         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  624.         kDETcmdExit                        Called once when template is freed (good time to free private data)
  625.  
  626.         kDETcmdAttributeCreation        New sublist attribute creation about to occur; this gives the template a chance to modify
  627.                                         the value that's about to be created; sent to the template that will be used for
  628.                                         the main aspect of the new entry
  629.  
  630.         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  631.  
  632.         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  633.         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  634.  
  635.         kDETcmdIdle                        Called periodically during idle times
  636.  
  637.         kDETcmdViewListChanged            Called when the info-page view-list (list of enabled views) has changed
  638.  
  639.         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (or kDETDidNotHandle) if it's OK to do so
  640.  
  641.         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  642.         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  643.  
  644.         kDETcmdAttributeNew                Attribute value new (return kDETDidNotHandle to let normal new processing occur)
  645.         kDETcmdAttributeChange            Attribute value change (return kDETDidNotHandle to let normal change processing occur)
  646.         kDETcmdAttributeDelete            Attribute value delete (return kDETDidNotHandle to let normal deletion occur); sent to the
  647.                                         main aspect of the attribute that's about to be deleted
  648.         kDETcmdItemNew                    Target item (record or attribute) has just been created
  649.  
  650.         kDETcmdOpenSelf                    Self open (return noErr to prevent opening; return kDETDidNotHandle to allow it)
  651.  
  652.         kDETcmdDynamicResource            Return a dynamically created resource
  653.  
  654.         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from catalog)
  655.         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  656.  
  657.         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  658.  
  659.         kDETcmdMaximumTextLength        Return maximum size for text form of property
  660.  
  661.         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  662.  
  663.         kDETcmdPatternIn                Custom pattern element encountered on reading in an attribute
  664.         kDETcmdPatternOut                Custom pattern element encountered on writing out an attribute
  665.  
  666.         kDETcmdConvertToNumber            Convert from template-defined property type to number
  667.         kDETcmdConvertToRString            Convert from template-defined property type to RString
  668.         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  669.         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  670.  
  671.         kDETcmdCustomViewDraw            Custom view draw
  672.         kDETcmdCustomViewMouseDown        Custom view mouse down
  673.  
  674.         kDETcmdKeyPress                    Key press (used primarily to filter entry into EditText views)
  675.         kDETcmdPaste                    Paste (used primarily to filter entry into EditText views)
  676.  
  677.         kDETcmdCustomMenuSelected        Custom Catalogs menu selected
  678.         kDETcmdCustomMenuEnabled        Return whether custom Catalogs menu entry should be enabled
  679. */
  680.  
  681.  
  682. enum {
  683.     kDETcmdSimpleCall            = 0,
  684.     kDETcmdInit                    = 1,
  685.     kDETcmdExit                    = 2,
  686.     kDETcmdAttributeCreation    = 3,
  687.     kDETcmdDynamicForwarders    = 4,
  688.     kDETcmdTargetedCall            = 1000,
  689.     kDETcmdInstanceInit            = 1001,
  690.     kDETcmdInstanceExit            = 1002,
  691.     kDETcmdIdle                    = 1003,
  692.     kDETcmdViewListChanged        = 1004,
  693.     kDETcmdValidateSave            = 1005,
  694.     kDETcmdDropQuery            = 1006,
  695.     kDETcmdDropMeQuery            = 1007,
  696.     kDETcmdAttributeNew            = 1008,
  697.     kDETcmdAttributeChange        = 1009,
  698.     kDETcmdAttributeDelete        = 1010,
  699.     kDETcmdItemNew                = 1011,
  700.     kDETcmdOpenSelf                = 1012,
  701.     kDETcmdDynamicResource        = 1013,
  702.     kDETcmdShouldSync            = 1014,
  703.     kDETcmdDoSync                = 1015,
  704.     kDETcmdPropertyCall            = 2000,
  705.     kDETcmdPropertyCommand        = 2001,
  706.     kDETcmdMaximumTextLength    = 2002,
  707.     kDETcmdPropertyDirtied        = 2003,
  708.     kDETcmdPatternIn            = 2004,
  709.     kDETcmdPatternOut            = 2005,
  710.     kDETcmdConvertToNumber        = 2006,
  711.     kDETcmdConvertToRString        = 2007,
  712.     kDETcmdConvertFromNumber    = 2008,
  713.     kDETcmdConvertFromRString    = 2009,
  714.     kDETcmdCustomViewDraw        = 2010,
  715.     kDETcmdCustomViewMouseDown    = 2011,
  716.     kDETcmdKeyPress                = 2012,
  717.     kDETcmdPaste                = 2013,
  718.     kDETcmdCustomMenuSelected    = 2014,
  719.     kDETcmdCustomMenuEnabled    = 2015,
  720.     kDETcmdHighCall                = (long)0xF0000000                /* Force the type to be long */
  721. };
  722.  
  723. typedef unsigned long                     DETCallFunctions;
  724. /* Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): */
  725.  
  726. enum {
  727.     kDETDoNothing                = FOUR_CHAR_CODE('xxx0'),
  728.     kDETMove                    = FOUR_CHAR_CODE('move'),
  729.     kDETDrag                    = FOUR_CHAR_CODE('drag'),
  730.     kDETAlias                    = FOUR_CHAR_CODE('alis')
  731. };
  732.  
  733.  
  734.  
  735. struct DETProtoCallBackBlock {
  736.     DETCallBackFunctions             reqFunction;                /* Requested function */
  737.     DETTargetSpecification             target;                        /* The target for the request */
  738.     short                             property;                    /* The property to apply the request to */
  739. };
  740. typedef struct DETProtoCallBackBlock    DETProtoCallBackBlock;
  741.  
  742. struct DETBeepBlock {
  743.     DETCallBackFunctions             reqFunction;                /* Requested function */
  744. };
  745. typedef struct DETBeepBlock                DETBeepBlock;
  746.  
  747. struct DETBusyBlock {
  748.     DETCallBackFunctions             reqFunction;                /* Requested function */
  749. };
  750. typedef struct DETBusyBlock                DETBusyBlock;
  751.  
  752. struct DETChangeCallForsBlock {
  753.     DETCallBackFunctions             reqFunction;                /* Requested function */
  754.     DETTargetSpecification             target;                        /* The target for the request */
  755.     long                             newCallFors;                /*  -> New call-for mask */
  756. };
  757. typedef struct DETChangeCallForsBlock    DETChangeCallForsBlock;
  758.  
  759. struct DETGetCommandSelectionCountBlock {
  760.     DETCallBackFunctions             reqFunction;                /* Requested function */
  761.     long                             count;                        /* <-  The number of items in the command selection list */
  762. };
  763. typedef struct DETGetCommandSelectionCountBlock DETGetCommandSelectionCountBlock;
  764.  
  765. enum {
  766.     kDETHFSType                    = 0,                            /* HFS item type */
  767.     kDETDSType                    = 1,                            /* Catalog Service item type */
  768.     kDETMailType                = 2,                            /* Mail (letter) item type */
  769.     kDETMoverType                = 3,                            /* Sounds, fonts, etc., from inside a suitcase or system file */
  770.     kDETLastItemType            = (long)0xF0000000                /* Force it to be a long (C & C++ seem to disagree about the definition of 0xF000) */
  771. };
  772.  
  773.  
  774. typedef unsigned long                     DETItemType;
  775. /* FSSpec plus possibly interesting additional info */
  776.  
  777. struct DETFSInfo {
  778.     OSType                             fileType;                    /* File type */
  779.     OSType                             fileCreator;                /* File creator */
  780.     unsigned short                     fdFlags;                    /* Finder flags */
  781.     FSSpec                             fsSpec;                        /* FSSpec */
  782. };
  783. typedef struct DETFSInfo                DETFSInfo;
  784.  
  785. struct DSRec {
  786.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  787.     short                             refNum;                        /* <-  Refnum for returned address */
  788.     AuthIdentity                     identity;                    /* <-  Identity for returned address */
  789. };
  790. typedef struct DSRec                    DSRec;
  791.  
  792. union ItemRec {
  793.     DETFSInfo **                    fsInfo;                        /* <-  FSSpec & info for item (caller must DisposHandle() when done) */
  794.     DSRec                             ds;
  795.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  796.     LetterSpec **                    ltrSpec;                    /* <-  Letter spec for item (caller must DisposHandle() when done) */
  797. };
  798. typedef union ItemRec                    ItemRec;
  799.  
  800. struct DETGetCommandItemNBlock {
  801.     DETCallBackFunctions             reqFunction;                /* Requested function */
  802.     long                             itemNumber;                    /*  -> Item number to retrieve (1-based) */
  803.     DETItemType                     itemType;                    /*  -> Type of item to be returned (if we can interpret it as such) */
  804.     ItemRec                         item;
  805. };
  806. typedef struct DETGetCommandItemNBlock    DETGetCommandItemNBlock;
  807.  
  808. struct DETGetDSSpecBlock {
  809.     DETCallBackFunctions             reqFunction;                /* Requested function */
  810.     DETTargetSpecification             target;                        /* The target for the request */
  811.     PackedDSSpecPtr *                dsSpec;                        /* <-  Handle with result (caller must DisposHandle() when done) */
  812.     short                             refNum;                        /* <-  Refnum for address if PD */
  813.     AuthIdentity                     identity;                    /* <-  Identity for address */
  814.     Boolean                         isAlias;                    /* <-  True if this entry is an alias */
  815.     Boolean                         isRecordRef;                /* <-  True if this entry is a record reference (reserved) */
  816. };
  817. typedef struct DETGetDSSpecBlock        DETGetDSSpecBlock;
  818.  
  819. struct DETGetTemplateFSSpecBlock {
  820.     DETCallBackFunctions             reqFunction;                /* Requested function */
  821.     DETTargetSpecification             target;                        /* The target for the request */
  822.     FSSpec                             fsSpec;                        /* <-  FSSpec of template file */
  823.     short                             baseID;                        /* <-  Base ID of this template */
  824.     long                             aspectTemplateNumber;        /* <-  The template number for this aspect template */
  825. };
  826. typedef struct DETGetTemplateFSSpecBlock DETGetTemplateFSSpecBlock;
  827.  
  828. struct DETGetOpenEditBlock {
  829.     DETCallBackFunctions             reqFunction;                /* Requested function */
  830.     DETTargetSpecification             target;                        /* The target for the request */
  831.     short                             viewProperty;                /* <-  The property of the view being edited (or kNoProperty if none) */
  832. };
  833. typedef struct DETGetOpenEditBlock        DETGetOpenEditBlock;
  834.  
  835. struct DETCloseEditBlock {
  836.     DETCallBackFunctions             reqFunction;                /* Requested function */
  837.     DETTargetSpecification             target;                        /* The target for the request */
  838. };
  839. typedef struct DETCloseEditBlock        DETCloseEditBlock;
  840.  
  841. struct DETGetPropertyTypeBlock {
  842.     DETCallBackFunctions             reqFunction;                /* Requested function */
  843.     DETTargetSpecification             target;                        /* The target for the request */
  844.     short                             property;                    /* The property to apply the request to */
  845.     short                             propertyType;                /* <-  The type of the property */
  846. };
  847. typedef struct DETGetPropertyTypeBlock    DETGetPropertyTypeBlock;
  848.  
  849. struct DETGetPropertyNumberBlock {
  850.     DETCallBackFunctions             reqFunction;                /* Requested function */
  851.     DETTargetSpecification             target;                        /* The target for the request */
  852.     short                             property;                    /* The property to apply the request to */
  853.     unsigned long                     propertyValue;                /* <-  The value of the property */
  854. };
  855. typedef struct DETGetPropertyNumberBlock DETGetPropertyNumberBlock;
  856.  
  857. struct DETGetPropertyRStringBlock {
  858.     DETCallBackFunctions             reqFunction;                /* Requested function */
  859.     DETTargetSpecification             target;                        /* The target for the request */
  860.     short                             property;                    /* The property to apply the request to */
  861.     RStringHandle                     propertyValue;                /* <-  A handle containing the property (as an RString) (caller must DisposHandle() when done) */
  862. };
  863. typedef struct DETGetPropertyRStringBlock DETGetPropertyRStringBlock;
  864.  
  865. struct DETGetPropertyBinarySizeBlock {
  866.     DETCallBackFunctions             reqFunction;                /* Requested function */
  867.     DETTargetSpecification             target;                        /* The target for the request */
  868.     short                             property;                    /* The property to apply the request to */
  869.     long                             propertyBinarySize;            /* <-  The size of the property as a binary block */
  870. };
  871. typedef struct DETGetPropertyBinarySizeBlock DETGetPropertyBinarySizeBlock;
  872.  
  873. struct DETGetPropertyBinaryBlock {
  874.     DETCallBackFunctions             reqFunction;                /* Requested function */
  875.     DETTargetSpecification             target;                        /* The target for the request */
  876.     short                             property;                    /* The property to apply the request to */
  877.     Handle                             propertyValue;                /* <-  Handle with the value of the property (caller must DisposHandle() when done) */
  878. };
  879. typedef struct DETGetPropertyBinaryBlock DETGetPropertyBinaryBlock;
  880.  
  881. struct DETGetPropertyChangedBlock {
  882.     DETCallBackFunctions             reqFunction;                /* Requested function */
  883.     DETTargetSpecification             target;                        /* The target for the request */
  884.     short                             property;                    /* The property to apply the request to */
  885.     Boolean                         propertyChanged;            /* <-  True if the property is marked as changed */
  886.     Boolean                         filler1;
  887. };
  888. typedef struct DETGetPropertyChangedBlock DETGetPropertyChangedBlock;
  889.  
  890. struct DETGetPropertyEditableBlock {
  891.     DETCallBackFunctions             reqFunction;                /* Requested function */
  892.     DETTargetSpecification             target;                        /* The target for the request */
  893.     short                             property;                    /* The property to apply the request to */
  894.     Boolean                         propertyEditable;            /* <-  True if the property can be edited by the user (if false, view will appear disabled) */
  895.     Boolean                         filler1;
  896. };
  897. typedef struct DETGetPropertyEditableBlock DETGetPropertyEditableBlock;
  898.  
  899. struct DETSetPropertyTypeBlock {
  900.     DETCallBackFunctions             reqFunction;                /* Requested function */
  901.     DETTargetSpecification             target;                        /* The target for the request */
  902.     short                             property;                    /* The property to apply the request to */
  903.     short                             newType;                    /*  -> New type for property (just sets type, does not convert contents) */
  904. };
  905. typedef struct DETSetPropertyTypeBlock    DETSetPropertyTypeBlock;
  906.  
  907. struct DETSetPropertyNumberBlock {
  908.     DETCallBackFunctions             reqFunction;                /* Requested function */
  909.     DETTargetSpecification             target;                        /* The target for the request */
  910.     short                             property;                    /* The property to apply the request to */
  911.     unsigned long                     newValue;                    /*  -> New value to set property to (and set type to number) */
  912. };
  913. typedef struct DETSetPropertyNumberBlock DETSetPropertyNumberBlock;
  914.  
  915. struct DETSetPropertyRStringBlock {
  916.     DETCallBackFunctions             reqFunction;                /* Requested function */
  917.     DETTargetSpecification             target;                        /* The target for the request */
  918.     short                             property;                    /* The property to apply the request to */
  919.     RStringPtr                         newValue;                    /*  -> New value to set property to (and set type to RString) */
  920. };
  921. typedef struct DETSetPropertyRStringBlock DETSetPropertyRStringBlock;
  922.  
  923. struct DETSetPropertyBinaryBlock {
  924.     DETCallBackFunctions             reqFunction;                /* Requested function */
  925.     DETTargetSpecification             target;                        /* The target for the request */
  926.     short                             property;                    /* The property to apply the request to */
  927.     void *                            newValue;                    /*  -> New value to set property to (and set type to binary) */
  928.     long                             newValueSize;                /*  -> Size of new value */
  929. };
  930. typedef struct DETSetPropertyBinaryBlock DETSetPropertyBinaryBlock;
  931.  
  932. struct DETSetPropertyChangedBlock {
  933.     DETCallBackFunctions             reqFunction;                /* Requested function */
  934.     DETTargetSpecification             target;                        /* The target for the request */
  935.     short                             property;                    /* The property to apply the request to */
  936.     Boolean                         propertyChanged;            /*  -> Value to set changed flag on property to */
  937.     Boolean                         filler1;
  938. };
  939. typedef struct DETSetPropertyChangedBlock DETSetPropertyChangedBlock;
  940.  
  941. struct DETSetPropertyEditableBlock {
  942.     DETCallBackFunctions             reqFunction;                /* Requested function */
  943.     DETTargetSpecification             target;                        /* The target for the request */
  944.     short                             property;                    /* The property to apply the request to */
  945.     Boolean                         propertyEditable;            /*  -> Value to set editable flag on property to */
  946.     Boolean                         filler1;
  947. };
  948. typedef struct DETSetPropertyEditableBlock DETSetPropertyEditableBlock;
  949.  
  950. struct DETDirtyPropertyBlock {
  951.     DETCallBackFunctions             reqFunction;                /* Requested function */
  952.     DETTargetSpecification             target;                        /* The target for the request */
  953.     short                             property;                    /* The property to apply the request to */
  954. };
  955. typedef struct DETDirtyPropertyBlock    DETDirtyPropertyBlock;
  956.  
  957. struct DETDoPropertyCommandBlock {
  958.     DETCallBackFunctions             reqFunction;                /* Requested function */
  959.     DETTargetSpecification             target;                        /* The target for the request */
  960.     short                             property;                    /* The property to apply the request to */
  961.     long                             parameter;                    /* ->  Parameter of command */
  962. };
  963. typedef struct DETDoPropertyCommandBlock DETDoPropertyCommandBlock;
  964.  
  965. struct DETSublistCountBlock {
  966.     DETCallBackFunctions             reqFunction;                /* Requested function */
  967.     DETTargetSpecification             target;                        /* The target for the request */
  968.     long                             count;                        /* <-  The number of items in the current item's sublist */
  969. };
  970. typedef struct DETSublistCountBlock        DETSublistCountBlock;
  971.  
  972. struct DETSelectedSublistCountBlock {
  973.     DETCallBackFunctions             reqFunction;                /* Requested function */
  974.     DETTargetSpecification             target;                        /* The target for the request */
  975.     long                             count;                        /* <-  The number of selected items in the current item's sublist */
  976. };
  977. typedef struct DETSelectedSublistCountBlock DETSelectedSublistCountBlock;
  978.  
  979. struct DETRequestSyncBlock {
  980.     DETCallBackFunctions             reqFunction;                /* Requested function */
  981.     DETTargetSpecification             target;                        /* The target for the request */
  982. };
  983. typedef struct DETRequestSyncBlock        DETRequestSyncBlock;
  984.  
  985. struct DETAddMenuBlock {
  986.     DETCallBackFunctions             reqFunction;                /* Requested function */
  987.     DETTargetSpecification             target;                        /* The target for the request */
  988.     short                             property;                    /* The property to apply the request to */
  989.     RString *                        name;                        /*  -> Name of new menu item */
  990.     long                             parameter;                    /*  -> Parameter to return when this item is selected */
  991.     long                             addAfter;                    /*  -> Parameter of entry to add after, or -1 for add at end */
  992. };
  993. typedef struct DETAddMenuBlock            DETAddMenuBlock;
  994.  
  995. struct DETRemoveMenuBlock {
  996.     DETCallBackFunctions             reqFunction;                /* Requested function */
  997.     DETTargetSpecification             target;                        /* The target for the request */
  998.     short                             property;                    /* The property to apply the request to */
  999.     long                             itemToRemove;                /*  -> Parameter of menu item to remove */
  1000. };
  1001. typedef struct DETRemoveMenuBlock        DETRemoveMenuBlock;
  1002.  
  1003. struct DETMenuItemRStringBlock {
  1004.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1005.     DETTargetSpecification             target;                        /* The target for the request */
  1006.     short                             property;                    /* The property to apply the request to */
  1007.     long                             itemParameter;                /*  -> Parameter of menu item to return string for */
  1008.     RStringHandle                     rString;                    /* <-  Handle with the RString (caller must DisposHandle() when done) */
  1009. };
  1010. typedef struct DETMenuItemRStringBlock    DETMenuItemRStringBlock;
  1011.  
  1012. struct DETOpenDSSpecBlock {
  1013.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1014.     PackedDSSpecPtr                 dsSpec;                        /*  -> DSSpec of object to be opened */
  1015. };
  1016. typedef struct DETOpenDSSpecBlock        DETOpenDSSpecBlock;
  1017.  
  1018. struct DETAboutToTalkBlock {
  1019.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1020. };
  1021. typedef struct DETAboutToTalkBlock        DETAboutToTalkBlock;
  1022.  
  1023. struct DETBreakAttributeBlock {
  1024.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1025.     DETTargetSpecification             target;                        /* The target for the request */
  1026.     AttributePtr                     breakAttribute;                /*  -> Attribute to parse */
  1027.     Boolean                         isChangeable;                /*  -> True if the value can be changed by the user */
  1028.     Boolean                         filler1;
  1029. };
  1030. typedef struct DETBreakAttributeBlock    DETBreakAttributeBlock;
  1031.  
  1032. struct DETSavePropertyBlock {
  1033.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1034.     DETTargetSpecification             target;                        /* The target for the request */
  1035.     short                             property;                    /* The property to apply the request to */
  1036. };
  1037. typedef struct DETSavePropertyBlock        DETSavePropertyBlock;
  1038.  
  1039. struct DETGetCustomViewUserReferenceBlock {
  1040.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1041.     DETTargetSpecification             target;                        /* The target for the request */
  1042.     short                             property;                    /* The property to apply the request to */
  1043.     short                             userReference;                /* <-  User reference value, as specified in the .r file */
  1044. };
  1045. typedef struct DETGetCustomViewUserReferenceBlock DETGetCustomViewUserReferenceBlock;
  1046.  
  1047. struct DETGetCustomViewBoundsBlock {
  1048.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1049.     DETTargetSpecification             target;                        /* The target for the request */
  1050.     short                             property;                    /* The property to apply the request to */
  1051.     Rect                             bounds;                        /* <-  Bounds of the view */
  1052. };
  1053. typedef struct DETGetCustomViewBoundsBlock DETGetCustomViewBoundsBlock;
  1054.  
  1055. struct DETGetResourceBlock {
  1056.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1057.     DETTargetSpecification             target;                        /* The target for the request */
  1058.     short                             property;                    /* The property to apply the request to */
  1059.     ResType                         resourceType;                /*  -> Resource type */
  1060.     Handle                             theResource;                /* <-  The resource handle (caller must dispose when done) */
  1061. };
  1062. typedef struct DETGetResourceBlock        DETGetResourceBlock;
  1063.  
  1064. struct DETTemplateCounts {
  1065.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1066.     long                             aspectTemplateCount;        /* <-  Number of aspect templates in the system */
  1067.     long                             infoPageTemplateCount;        /* <-  Number of info-page templates in the system */
  1068. };
  1069. typedef struct DETTemplateCounts        DETTemplateCounts;
  1070.  
  1071. struct DETUnloadTemplatesBlock {
  1072.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1073. };
  1074. typedef struct DETUnloadTemplatesBlock    DETUnloadTemplatesBlock;
  1075.  
  1076.  
  1077. union DETCallBackBlock {
  1078.     DETProtoCallBackBlock             protoCallBack;
  1079.     DETBeepBlock                     beep;
  1080.     DETBusyBlock                     busy;
  1081.     DETChangeCallForsBlock             changeCallFors;
  1082.     DETGetCommandSelectionCountBlock  getCommandSelectionCount;
  1083.     DETGetCommandItemNBlock         getCommandItemN;
  1084.     DETGetDSSpecBlock                 getDSSpec;
  1085.     DETGetTemplateFSSpecBlock         getTemplateFSSpec;
  1086.     DETGetOpenEditBlock             getOpenEdit;
  1087.     DETCloseEditBlock                 closeEdit;
  1088.     DETGetPropertyTypeBlock         getPropertyType;
  1089.     DETGetPropertyNumberBlock         getPropertyNumber;
  1090.     DETGetPropertyRStringBlock         getPropertyRString;
  1091.     DETGetPropertyBinarySizeBlock     getPropertyBinarySize;
  1092.     DETGetPropertyBinaryBlock         getPropertyBinary;
  1093.     DETGetPropertyChangedBlock         getPropertyChanged;
  1094.     DETGetPropertyEditableBlock     getPropertyEditable;
  1095.     DETSetPropertyTypeBlock         setPropertyType;
  1096.     DETSetPropertyNumberBlock         setPropertyNumber;
  1097.     DETSetPropertyRStringBlock         setPropertyRString;
  1098.     DETSetPropertyBinaryBlock         setPropertyBinary;
  1099.     DETSetPropertyChangedBlock         setPropertyChanged;
  1100.     DETSetPropertyEditableBlock     setPropertyEditable;
  1101.     DETDirtyPropertyBlock             dirtyProperty;
  1102.     DETDoPropertyCommandBlock         doPropertyCommand;
  1103.     DETSublistCountBlock             sublistCount;
  1104.     DETSelectedSublistCountBlock     selectedSublistCount;
  1105.     DETRequestSyncBlock             requestSync;
  1106.     DETAddMenuBlock                 addMenu;
  1107.     DETRemoveMenuBlock                 removeMenu;
  1108.     DETMenuItemRStringBlock         menuItemRString;
  1109.     DETOpenDSSpecBlock                 openDSSpec;
  1110.     DETAboutToTalkBlock             aboutToTalk;
  1111.     DETBreakAttributeBlock             breakAttribute;
  1112.     DETSavePropertyBlock             saveProperty;
  1113.     DETGetCustomViewUserReferenceBlock  getCustomViewUserReference;
  1114.     DETGetCustomViewBoundsBlock     getCustomViewBounds;
  1115.     DETGetResourceBlock             getResource;
  1116.     DETTemplateCounts                 templateCounts;
  1117.     DETUnloadTemplatesBlock         unloadTemplates;
  1118. };
  1119. typedef union DETCallBackBlock            DETCallBackBlock;
  1120. typedef DETCallBackBlock *                DETCallBackBlockPtr;
  1121. typedef union DETCallBlock                 DETCallBlock;
  1122.  
  1123. typedef DETCallBlock *                    DETCallBlockPtr;
  1124. typedef CALLBACK_API( OSErr , DETCallBackProcPtr )(DETCallBlock *callBlockPtr, DETCallBackBlockPtr callBackBlockPtr);
  1125. typedef STACK_UPP_TYPE(DETCallBackProcPtr)                         DETCallBackUPP;
  1126. typedef DETCallBackUPP                     DETCallBack;
  1127.  
  1128. struct DETProtoCallBlock {
  1129.     DETCallFunctions                 reqFunction;                /* Requested function */
  1130.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1131.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1132.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1133.                                                                 /*    common to all invocations of code resource) */
  1134.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1135.                                                                 /*    code resource) */
  1136.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1137.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1138.     Boolean                         filler1;
  1139.     short                             property;                    /* The property number the call refers to */
  1140. };
  1141. typedef struct DETProtoCallBlock        DETProtoCallBlock;
  1142.  
  1143. struct DETInitBlock {
  1144.     DETCallFunctions                 reqFunction;                /* Requested function */
  1145.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1146.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1147.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1148.     long                             newCallFors;                /* <-  New call-for mask */
  1149. };
  1150. typedef struct DETInitBlock                DETInitBlock;
  1151.  
  1152. struct DETExitBlock {
  1153.     DETCallFunctions                 reqFunction;                /* Requested function */
  1154.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1155.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1156.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1157. };
  1158. typedef struct DETExitBlock                DETExitBlock;
  1159.  
  1160. struct DETInstanceInitBlock {
  1161.     DETCallFunctions                 reqFunction;                /* Requested function */
  1162.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1163.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1164.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1165.                                                                 /*    common to all invocations of code resource) */
  1166.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1167.                                                                 /*    code resource) */
  1168.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1169.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1170.     Boolean                         filler1;
  1171. };
  1172. typedef struct DETInstanceInitBlock        DETInstanceInitBlock;
  1173.  
  1174. struct DETInstanceExitBlock {
  1175.     DETCallFunctions                 reqFunction;                /* Requested function */
  1176.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1177.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1178.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1179.                                                                 /*    common to all invocations of code resource) */
  1180.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1181.                                                                 /*    code resource) */
  1182.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1183.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1184.     Boolean                         filler1;
  1185. };
  1186. typedef struct DETInstanceExitBlock        DETInstanceExitBlock;
  1187.  
  1188. struct DETInstanceIdleBlock {
  1189.     DETCallFunctions                 reqFunction;                /* Requested function */
  1190.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1191.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1192.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1193.                                                                 /*    common to all invocations of code resource) */
  1194.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1195.                                                                 /*    code resource) */
  1196.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1197.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1198.     Boolean                         filler1;
  1199. };
  1200. typedef struct DETInstanceIdleBlock        DETInstanceIdleBlock;
  1201.  
  1202. struct DETPropertyCommandBlock {
  1203.     DETCallFunctions                 reqFunction;                /* Requested function */
  1204.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1205.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1206.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1207.                                                                 /*    common to all invocations of code resource) */
  1208.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1209.                                                                 /*    code resource) */
  1210.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1211.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1212.     Boolean                         filler1;
  1213.     short                             property;                    /* The property number the call refers to */
  1214.     long                             parameter;                    /*  -> Parameter of command */
  1215. };
  1216. typedef struct DETPropertyCommandBlock    DETPropertyCommandBlock;
  1217.  
  1218. struct DETMaximumTextLengthBlock {
  1219.     DETCallFunctions                 reqFunction;                /* Requested function */
  1220.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1221.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1222.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1223.                                                                 /*    common to all invocations of code resource) */
  1224.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1225.                                                                 /*    code resource) */
  1226.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1227.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1228.     Boolean                         filler1;
  1229.     short                             property;                    /* The property number the call refers to */
  1230.     long                             maxSize;                    /* <-  Return the maximum number of characters the user can entry when property is edited in an EditText */
  1231. };
  1232. typedef struct DETMaximumTextLengthBlock DETMaximumTextLengthBlock;
  1233.  
  1234. struct DETViewListChangedBlock {
  1235.     DETCallFunctions                 reqFunction;                /* Requested function */
  1236.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1237.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1238.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1239.                                                                 /*    common to all invocations of code resource) */
  1240.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1241.                                                                 /*    code resource) */
  1242.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1243.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1244.     Boolean                         filler1;
  1245. };
  1246. typedef struct DETViewListChangedBlock    DETViewListChangedBlock;
  1247.  
  1248. struct DETPropertyDirtiedBlock {
  1249.     DETCallFunctions                 reqFunction;                /* Requested function */
  1250.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1251.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1252.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1253.                                                                 /*    common to all invocations of code resource) */
  1254.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1255.                                                                 /*    code resource) */
  1256.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1257.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1258.     Boolean                         filler1;
  1259.     short                             property;                    /* The property number the call refers to */
  1260. };
  1261. typedef struct DETPropertyDirtiedBlock    DETPropertyDirtiedBlock;
  1262.  
  1263. struct DETValidateSaveBlock {
  1264.     DETCallFunctions                 reqFunction;                /* Requested function */
  1265.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1266.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1267.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1268.                                                                 /*    common to all invocations of code resource) */
  1269.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1270.                                                                 /*    code resource) */
  1271.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1272.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1273.     Boolean                         filler1;
  1274.     RStringHandle                     errorString;                /* <-  Handle with error string if validation fails (callee must allocate handle, DE will DisposHandle() it) */
  1275. };
  1276. typedef struct DETValidateSaveBlock        DETValidateSaveBlock;
  1277.  
  1278. struct DETDropQueryBlock {
  1279.     DETCallFunctions                 reqFunction;                /* Requested function */
  1280.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1281.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1282.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1283.                                                                 /*    common to all invocations of code resource) */
  1284.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1285.                                                                 /*    code resource) */
  1286.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1287.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1288.     Boolean                         filler1;
  1289.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1290.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1291.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1292.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1293.     Boolean                         filler2;
  1294. };
  1295. typedef struct DETDropQueryBlock        DETDropQueryBlock;
  1296.  
  1297. struct DETDropMeQueryBlock {
  1298.     DETCallFunctions                 reqFunction;                /* Requested function */
  1299.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1300.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1301.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1302.                                                                 /*    common to all invocations of code resource) */
  1303.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1304.                                                                 /*    code resource) */
  1305.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1306.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1307.     Boolean                         filler1;
  1308.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1309.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1310.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1311.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1312.     Boolean                         filler2;
  1313. };
  1314. typedef struct DETDropMeQueryBlock        DETDropMeQueryBlock;
  1315.  
  1316. struct DETAttributeCreationBlock {
  1317.     DETCallFunctions                 reqFunction;                /* Requested function */
  1318.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1319.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1320.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1321.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1322.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1323.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1324.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1325.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1326.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1327. };
  1328. typedef struct DETAttributeCreationBlock DETAttributeCreationBlock;
  1329.  
  1330. struct DETAttributeNewBlock {
  1331.     DETCallFunctions                 reqFunction;                /* Requested function */
  1332.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1333.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1334.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1335.                                                                 /*    common to all invocations of code resource) */
  1336.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1337.                                                                 /*    code resource) */
  1338.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1339.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1340.     Boolean                         filler1;
  1341.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1342.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1343.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1344.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1345.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1346.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1347. };
  1348. typedef struct DETAttributeNewBlock        DETAttributeNewBlock;
  1349.  
  1350. struct DETAttributeChangeBlock {
  1351.     DETCallFunctions                 reqFunction;                /* Requested function */
  1352.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1353.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1354.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1355.                                                                 /*    common to all invocations of code resource) */
  1356.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1357.                                                                 /*    code resource) */
  1358.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1359.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1360.     Boolean                         filler1;
  1361.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1362.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1363.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1364.     AttributeType                     attrType;                    /* <-> The type of the attribute being changed */
  1365.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being changed */
  1366.     AttributeCreationID             attrCID;                    /* <-> The CID of the attribute being changed */
  1367.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1368. };
  1369. typedef struct DETAttributeChangeBlock    DETAttributeChangeBlock;
  1370.  
  1371. struct DETAttributeDeleteBlock {
  1372.     DETCallFunctions                 reqFunction;                /* Requested function */
  1373.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1374.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1375.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1376.                                                                 /*    common to all invocations of code resource) */
  1377.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1378.                                                                 /*    code resource) */
  1379.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1380.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1381.     Boolean                         filler1;
  1382.     PackedDSSpecPtr                 dsSpec;                        /*  -> The object which will be deleted */
  1383.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1384.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as */
  1385. };
  1386. typedef struct DETAttributeDeleteBlock    DETAttributeDeleteBlock;
  1387.  
  1388. struct DETItemNewBlock {
  1389.     DETCallFunctions                 reqFunction;                /* Requested function */
  1390.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1391.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1392.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1393.                                                                 /*    common to all invocations of code resource) */
  1394.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1395.                                                                 /*    code resource) */
  1396.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1397.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1398.     Boolean                         filler1;
  1399. };
  1400. typedef struct DETItemNewBlock            DETItemNewBlock;
  1401.  
  1402. struct DETShouldSyncBlock {
  1403.     DETCallFunctions                 reqFunction;                /* Requested function */
  1404.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1405.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1406.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1407.                                                                 /*    common to all invocations of code resource) */
  1408.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1409.                                                                 /*    code resource) */
  1410.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1411.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1412.     Boolean                         filler1;
  1413.     Boolean                         shouldSync;                    /* <-  True if we should now sync with catalog */
  1414.     Boolean                         filler2;
  1415. };
  1416. typedef struct DETShouldSyncBlock        DETShouldSyncBlock;
  1417.  
  1418. struct DETDoSyncBlock {
  1419.     DETCallFunctions                 reqFunction;                /* Requested function */
  1420.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1421.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1422.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1423.                                                                 /*    common to all invocations of code resource) */
  1424.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1425.                                                                 /*    code resource) */
  1426.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1427.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1428.     Boolean                         filler1;
  1429. };
  1430. typedef struct DETDoSyncBlock            DETDoSyncBlock;
  1431.  
  1432. struct DETPatternInBlock {
  1433.     DETCallFunctions                 reqFunction;                /* Requested function */
  1434.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1435.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1436.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1437.                                                                 /*    common to all invocations of code resource) */
  1438.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1439.                                                                 /*    code resource) */
  1440.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1441.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1442.     Boolean                         filler1;
  1443.     short                             property;                    /* The property number the call refers to */
  1444.     long                             elementType;                /*  -> Element type from pattern */
  1445.     long                             extra;                        /*  -> Extra field from pattern */
  1446.     AttributePtr                     attribute;                    /*  -> The complete attribute */
  1447.     long                             dataOffset;                    /* <-> Offset to current (next) byte */
  1448.     short                             bitOffset;                    /* <-> Bit offset (next bit is *fData >> fBitOffset++) */
  1449. };
  1450. typedef struct DETPatternInBlock        DETPatternInBlock;
  1451.  
  1452. struct DETPatternOutBlock {
  1453.     DETCallFunctions                 reqFunction;                /* Requested function */
  1454.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1455.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1456.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1457.                                                                 /*    common to all invocations of code resource) */
  1458.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1459.                                                                 /*    code resource) */
  1460.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1461.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1462.     Boolean                         filler1;
  1463.     short                             property;                    /* The property number the call refers to */
  1464.     long                             elementType;                /*  -> Element type from pattern */
  1465.     long                             extra;                        /*  -> Extra field from pattern */
  1466.     AttributePtr                     attribute;                    /*  -> The attribute (minus the data portion) */
  1467.     Handle                             data;                        /*  -> Data to be written (pre-allocated, resize and add at end) */
  1468.     long                             dataOffset;                    /* <-> Offset to next byte to write */
  1469.     short                             bitOffset;                    /* <-> Bit offset (if zero, handle will need to be resized to one more byte before write) */
  1470. };
  1471. typedef struct DETPatternOutBlock        DETPatternOutBlock;
  1472.  
  1473. struct DETOpenSelfBlock {
  1474.     DETCallFunctions                 reqFunction;                /* Requested function */
  1475.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1476.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1477.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1478.                                                                 /*    common to all invocations of code resource) */
  1479.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1480.                                                                 /*    code resource) */
  1481.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1482.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1483.     Boolean                         filler1;
  1484.     short                             modifiers;                    /*  -> Modifiers at open time (option/control/command/shift keys) */
  1485. };
  1486. typedef struct DETOpenSelfBlock            DETOpenSelfBlock;
  1487.  
  1488. struct DETConvertToNumberBlock {
  1489.     DETCallFunctions                 reqFunction;                /* Requested function */
  1490.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1491.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1492.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1493.                                                                 /*    common to all invocations of code resource) */
  1494.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1495.                                                                 /*    code resource) */
  1496.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1497.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1498.     Boolean                         filler1;
  1499.     short                             property;                    /* The property number the call refers to */
  1500.     long                             theValue;                    /* <-  The converted value to return */
  1501. };
  1502. typedef struct DETConvertToNumberBlock    DETConvertToNumberBlock;
  1503.  
  1504. struct DETConvertToRStringBlock {
  1505.     DETCallFunctions                 reqFunction;                /* Requested function */
  1506.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1507.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1508.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1509.                                                                 /*    common to all invocations of code resource) */
  1510.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1511.                                                                 /*    code resource) */
  1512.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1513.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1514.     Boolean                         filler1;
  1515.     short                             property;                    /* The property number the call refers to */
  1516.     RStringHandle                     theValue;                    /* <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) */
  1517. };
  1518. typedef struct DETConvertToRStringBlock    DETConvertToRStringBlock;
  1519.  
  1520. struct DETConvertFromNumberBlock {
  1521.     DETCallFunctions                 reqFunction;                /* Requested function */
  1522.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1523.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1524.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1525.                                                                 /*    common to all invocations of code resource) */
  1526.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1527.                                                                 /*    code resource) */
  1528.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1529.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1530.     Boolean                         filler1;
  1531.     short                             property;                    /* The property number the call refers to */
  1532.     long                             theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1533. };
  1534. typedef struct DETConvertFromNumberBlock DETConvertFromNumberBlock;
  1535.  
  1536. struct DETConvertFromRStringBlock {
  1537.     DETCallFunctions                 reqFunction;                /* Requested function */
  1538.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1539.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1540.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1541.                                                                 /*    common to all invocations of code resource) */
  1542.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1543.                                                                 /*    code resource) */
  1544.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1545.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1546.     Boolean                         filler1;
  1547.     short                             property;                    /* The property number the call refers to */
  1548.     RStringPtr                         theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1549. };
  1550. typedef struct DETConvertFromRStringBlock DETConvertFromRStringBlock;
  1551.  
  1552. struct DETCustomViewDrawBlock {
  1553.     DETCallFunctions                 reqFunction;                /* Requested function */
  1554.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1555.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1556.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1557.                                                                 /*    common to all invocations of code resource) */
  1558.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1559.                                                                 /*    code resource) */
  1560.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1561.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1562.     Boolean                         filler1;
  1563.     short                             property;                    /* The property number the call refers to */
  1564. };
  1565. typedef struct DETCustomViewDrawBlock    DETCustomViewDrawBlock;
  1566.  
  1567. struct DETCustomViewMouseDownBlock {
  1568.     DETCallFunctions                 reqFunction;                /* Requested function */
  1569.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1570.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1571.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1572.                                                                 /*    common to all invocations of code resource) */
  1573.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1574.                                                                 /*    code resource) */
  1575.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1576.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1577.     Boolean                         filler1;
  1578.     short                             property;                    /* The property number the call refers to */
  1579.     EventRecord *                    theEvent;                    /*  -> The original event record of the mouse-down */
  1580. };
  1581. typedef struct DETCustomViewMouseDownBlock DETCustomViewMouseDownBlock;
  1582.  
  1583. struct DETKeyPressBlock {
  1584.     DETCallFunctions                 reqFunction;                /* Requested function */
  1585.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1586.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1587.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1588.                                                                 /*    common to all invocations of code resource) */
  1589.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1590.                                                                 /*    code resource) */
  1591.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1592.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1593.     Boolean                         filler1;
  1594.     short                             property;                    /* The property number the call refers to */
  1595.     EventRecord *                    theEvent;                    /*  -> The original event record of the key-press */
  1596. };
  1597. typedef struct DETKeyPressBlock            DETKeyPressBlock;
  1598.  
  1599. struct DETPasteBlock {
  1600.     DETCallFunctions                 reqFunction;                /* Requested function */
  1601.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1602.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1603.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1604.                                                                 /*    common to all invocations of code resource) */
  1605.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1606.                                                                 /*    code resource) */
  1607.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1608.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1609.     Boolean                         filler1;
  1610.     short                             property;                    /* The property number the call refers to */
  1611.     short                             modifiers;                    /*  -> Modifiers at paste time (option/control/command/shift keys) */
  1612. };
  1613. typedef struct DETPasteBlock            DETPasteBlock;
  1614.  
  1615. struct DETCustomMenuSelectedBlock {
  1616.     DETCallFunctions                 reqFunction;                /* Requested function */
  1617.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1618.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1619.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1620.                                                                 /*    common to all invocations of code resource) */
  1621.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1622.                                                                 /*    code resource) */
  1623.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1624.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1625.     Boolean                         filler1;
  1626.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1627. };
  1628. typedef struct DETCustomMenuSelectedBlock DETCustomMenuSelectedBlock;
  1629.  
  1630. struct DETCustomMenuEnabledBlock {
  1631.     DETCallFunctions                 reqFunction;                /* Requested function */
  1632.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1633.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1634.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1635.                                                                 /*    common to all invocations of code resource) */
  1636.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1637.                                                                 /*    code resource) */
  1638.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1639.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1640.     Boolean                         filler1;
  1641.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1642.     Boolean                         enable;                        /* <-  Whether to enable the menu item */
  1643.     Boolean                         filler2;
  1644. };
  1645. typedef struct DETCustomMenuEnabledBlock DETCustomMenuEnabledBlock;
  1646.  
  1647. struct DETForwarderListItem {
  1648.     struct DETForwarderListItem **    next;                        /* Pointer to next item, or nil */
  1649.     AttributeTag                     attributeValueTag;            /* Tag of new templates (0 for none) */
  1650.     PackedPathName                     rstrs;                        /* Record type (empty if none), attrbute type (empty if none),list of template names to forward to */
  1651. };
  1652. typedef struct DETForwarderListItem        DETForwarderListItem;
  1653.  
  1654. typedef DETForwarderListItem *            DETForwarderListPtr;
  1655. typedef DETForwarderListPtr *            DETForwarderListHandle;
  1656.  
  1657. struct DETDynamicForwardersBlock {
  1658.     DETCallFunctions                 reqFunction;                /* Requested function */
  1659.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1660.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1661.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1662.     DETForwarderListHandle             forwarders;                    /* <-  List of forwaders */
  1663. };
  1664. typedef struct DETDynamicForwardersBlock DETDynamicForwardersBlock;
  1665.  
  1666. struct DETDynamicResourceBlock {
  1667.     DETCallFunctions                 reqFunction;                /* Requested function */
  1668.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1669.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1670.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1671.                                                                 /*    common to all invocations of code resource) */
  1672.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1673.                                                                 /*    code resource) */
  1674.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1675.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1676.     Boolean                         filler1;
  1677.     ResType                         resourceType;                /*  -> The resource type being requested */
  1678.     short                             propertyNumber;                /*  -> The property number of the resource being requested */
  1679.     short                             resourceID;                    /*  -> The resource ID (base ID + property number) of the resource */
  1680.     Handle                             theResource;                /* <-  The requested resource */
  1681. };
  1682. typedef struct DETDynamicResourceBlock    DETDynamicResourceBlock;
  1683.  
  1684.  
  1685. union DETCallBlock {
  1686.     DETProtoCallBlock                 protoCall;
  1687.     DETInitBlock                     init;
  1688.     DETExitBlock                     exit;
  1689.     DETInstanceInitBlock             instanceInit;
  1690.     DETInstanceExitBlock             instanceExit;
  1691.     DETInstanceIdleBlock             instanceIdle;
  1692.     DETPropertyCommandBlock         propertyCommand;
  1693.     DETMaximumTextLengthBlock         maximumTextLength;
  1694.     DETViewListChangedBlock         viewListChanged;
  1695.     DETPropertyDirtiedBlock         propertyDirtied;
  1696.     DETValidateSaveBlock             validateSave;
  1697.     DETDropQueryBlock                 dropQuery;
  1698.     DETDropMeQueryBlock             dropMeQuery;
  1699.     DETAttributeCreationBlock         attributeCreationBlock;
  1700.     DETAttributeNewBlock             attributeNew;
  1701.     DETAttributeChangeBlock         attributeChange;
  1702.     DETAttributeDeleteBlock         attributeDelete;
  1703.     DETItemNewBlock                 itemNew;
  1704.     DETPatternInBlock                 patternIn;
  1705.     DETPatternOutBlock                 patternOut;
  1706.     DETShouldSyncBlock                 shouldSync;
  1707.     DETDoSyncBlock                     doSync;
  1708.     DETOpenSelfBlock                 openSelf;
  1709.     DETConvertToNumberBlock         convertToNumber;
  1710.     DETConvertToRStringBlock         convertToRString;
  1711.     DETConvertFromNumberBlock         convertFromNumber;
  1712.     DETConvertFromRStringBlock         convertFromRString;
  1713.     DETCustomViewDrawBlock             customViewDraw;
  1714.     DETCustomViewMouseDownBlock     customViewMouseDown;
  1715.     DETKeyPressBlock                 keyPress;
  1716.     DETPasteBlock                     paste;
  1717.     DETCustomMenuSelectedBlock         customMenuSelected;
  1718.     DETCustomMenuEnabledBlock         customMenuEnabled;
  1719.     DETDynamicForwardersBlock         dynamicForwarders;
  1720.     DETDynamicResourceBlock         dynamicResource;
  1721. };
  1722.  
  1723. enum { uppDETCallBackProcInfo = 0x000003E0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  1724. #define CallDETCallBackProc(userRoutine, callBlockPtr, callBackBlockPtr)  CALL_TWO_PARAMETER_UPP((userRoutine), uppDETCallBackProcInfo, (callBlockPtr), (callBackBlockPtr))
  1725. #define NewDETCallBackProc(userRoutine)                         (DETCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallBackProcInfo, GetCurrentArchitecture())
  1726. /* Call-for list: */
  1727.  
  1728. enum {
  1729.     kDETCallForOther            = 1,                            /* Call for things not listed below (also auto-enabled by DE if any of the below are enabled) */
  1730.     kDETCallForIdle                = 2,                            /* kDETcmdIdle */
  1731.     kDETCallForCommands            = 4,                            /* kDETcmdPropertyCommand, kDETcmdSelfOpen */
  1732.     kDETCallForViewChanges        = 8,                            /* kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength */
  1733.     kDETCallForDrops            = 0x10,                            /* kDETcmdDropQuery, kDETcmdDropMeQuery */
  1734.     kDETCallForAttributes        = 0x20,                            /* kDETcmdAttributeCreation, kDETcmdAttributeNew, kDETcmdAttributeChange, kDETcmdAttributeDelete */
  1735.     kDETCallForValidation        = 0x40,                            /* kDETcmdValidateSave */
  1736.     kDETCallForKeyPresses        = 0x80,                            /* kDETcmdKeyPress and kDETcmdPaste */
  1737.     kDETCallForResources        = 0x0100,                        /* kDETcmdDynamicResource */
  1738.     kDETCallForSyncing            = 0x0200,                        /* kDETcmdShouldSync, kDETcmdDoSync */
  1739.     kDETCallForEscalation        = 0x8000,                        /* All calls escalated from the next lower level */
  1740.     kDETCallForNothing            = 0,                            /* None of the above */
  1741.     kDETCallForEverything        = (long)0xFFFFFFFF                /* All of the above */
  1742. };
  1743.  
  1744. typedef CALLBACK_API( OSErr , DETCallProcPtr )(DETCallBlockPtr callBlockPtr);
  1745. typedef STACK_UPP_TYPE(DETCallProcPtr)                             DETCallUPP;
  1746. enum { uppDETCallProcInfo = 0x000000E0 };                         /* pascal 2_bytes Func(4_bytes) */
  1747. #define NewDETCallProc(userRoutine)                             (DETCallUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallProcInfo, GetCurrentArchitecture())
  1748. #define CallDETCallProc(userRoutine, callBlockPtr)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppDETCallProcInfo, (callBlockPtr))
  1749.  
  1750. typedef DETCallUPP                         DETCall;
  1751. /* This following macro saves you from having to dig out the call-back pointer from the call block: */
  1752. #define CallBackDET(callBlockPtr, callBackBlockPtr) CallDETCallBackProc(callBlockPtr->protoCall.callBack,callBlockPtr,callBackBlockPtr)
  1753. #endif /* REZ */
  1754.  
  1755. /************************************************************************************/
  1756. /********************************* SAM Definitions: *********************************/
  1757. /************************************************************************************/
  1758.  
  1759. /* SAM Developers should use property numbers starting at this point: */
  1760. #define kSAMFirstDevProperty                kDETFirstDevProperty + 10
  1761.  
  1762.  
  1763. /*
  1764.     SAM templates have additional resources/properties that are required
  1765.     for interaction with the AOCE Key Chain.
  1766.     
  1767.      Type    Offset                        Description
  1768.      ----    ------                        -----------
  1769.     'rstr'    kSAMAspectUserName            The user name
  1770.     'rstr'    kSAMAspectKind                The kind of SAM
  1771.     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  1772.     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  1773. */
  1774.  
  1775. #define kSAMAspectUserName                        kDETFirstDevProperty + 1
  1776. #define kSAMAspectKind                            kDETFirstDevProperty + 2
  1777. #define kSAMAspectCannotDelete                    kDETFirstDevProperty + 3
  1778. #define kSAMAspectSlotCreationInfo                kDETFirstDevProperty + 4
  1779.  
  1780. /**************************************************************************************
  1781.  ********************************* Admin Definitions: *********************************
  1782.  **************************************************************************************/
  1783.  
  1784. #define kDETAdminVersion         -978
  1785.  
  1786.  
  1787.  
  1788. #ifndef REZ
  1789.  
  1790. #endif /* REZ */
  1791.  
  1792. #if PRAGMA_STRUCT_ALIGN
  1793.     #pragma options align=reset
  1794. #elif PRAGMA_STRUCT_PACKPUSH
  1795.     #pragma pack(pop)
  1796. #elif PRAGMA_STRUCT_PACK
  1797.     #pragma pack()
  1798. #endif
  1799.  
  1800. #ifdef PRAGMA_IMPORT_OFF
  1801. #pragma import off
  1802. #elif PRAGMA_IMPORT
  1803. #pragma import reset
  1804. #endif
  1805.  
  1806. #ifdef __cplusplus
  1807. }
  1808. #endif
  1809.  
  1810. #endif /* __OCETEMPLATES__ */
  1811.  
  1812.